/**
 * BaseAlarmActivity.java $version 1.0 Nov 4, 2012
 *
 * Copyright 2011 Pravin Kumar Corp. All rights Reserved.
 * Pravin Kumar PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

package com.mobile.rail.alarm.ui;

import com.mobile.rail.alarm.constants.Constants;

import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.os.Bundle;

/**
 * Provide a brief description of BaseAlarmActivity. Specify the following
 * items: - What does it do. - Its dependencies. - What section / item in the
 * class document does it correspond to.
 * 
 * @author India
 */
public class BaseAlarmActivity extends Activity implements Constants {

	@Override
	protected Dialog onCreateDialog(int id) {
		hideProgress();
		switch (id) {
		case DIALOG_ID_PROGRESS:
			ProgressDialog dialog = new ProgressDialog(this);
			dialog.setMessage("Please Wait..");
			dialog.setIndeterminate(true);
			dialog.setCancelable(false);
			return dialog;

		}
		return super.onCreateDialog(id);
	}

	public void hideProgress() {
		try {
			removeDialog(DIALOG_ID_PROGRESS);
		} catch (IllegalArgumentException iae) {
			// That's ok if the trying to hide the progress already hidden
		}
	}

}
